<template>
	<!-- 流水账单 -->
	<view class="record">
		<view class="record_list">
			<!-- <p class="month">本月</p> -->
			<!-- 提现 -->
			<view class="month_list" v-for="(item,index) in dataList" :key="index">
				<p class="left" v-if="item.type == 4">
					<text class="text1">¥</text>
					<text class="text2">{{typeText[item.type-1]}}</text>
				</p>
				<p class="left" v-else-if="item.type == 1">
					<text class="text1" style="background-color: #5AA6F4;">¥</text>
					<text class="text2" style="color: #5AA6F4;">{{typeText[item.type-1]}}</text>
				</p>
				<p class="left" v-else-if="item.type == 2 || item.type == 3">
					<text class="text1" style="background-color: #F1B03D;">¥</text>
					<text class="text2" style="color: #F1B03D;">{{typeText[item.type-1]}}</text>
				</p>
				<p class="center" v-if="item.type == 4">
					-{{item.money}}
				</p>
				<p class="center" v-else>
					+{{item.money}}
				</p>
				<p class="right">
					<text :class="item.status == 0 ? 'onstatus' : 'text1'">{{item.status| setstatus}}</text>
					<text class="text2">{{item.create_time}}</text>
				</p>
			</view>
			<nodata v-if="dataList.length == 0"></nodata>
			<!-- 推荐 -->
			<!-- <view class="month_list">
				<p class="left" >
					<text class="text1" style="background-color: #5AA6F4;">¥</text>
					<text class="text2" style="color: #5AA6F4;">推荐</text>
				</p>
				<p class="center">
					+8.64
				</p>
				<p class="right">
					<text :class="status1 == 0 ? 'onstatus' : 'text1'">{{status1| setstatus}}</text>
					<text class="text2">2019-07-02</text>
				</p>
			</view> -->
			<!-- 提成 -->
			<!-- <view class="month_list">
				<p class="left" >
					<text class="text1" style="background-color: #F1B03D;">¥</text>
					<text class="text2" style="color: #F1B03D;">提成</text>
				</p>
				<p class="center">
					+8.64
				</p>
				<p class="right">
					<text :class="status1 == 0 ? 'onstatus' : 'text1'">{{status1| setstatus}}</text>
					<text class="text2">2019-07-02</text>
				</p>
			</view> -->
		</view>
		<ourLoading isFullScreen :active="active" text="loading..." />
	</view>
</template>

<script>
	import nodata from '@/components/nodata/nodata.vue'
	export default {
		components:{
			nodata
		},
		data(){
			return{
				status: 0,
				status1: 1,
				active:true,
				pageIndex: 1,
				dataList:[],
				typeText:['推荐','提成','提成','提现']
			}
		},
		onShow() {
			this.getList()
			setTimeout(()=>{
				this.active = false
			},600)
		},
		filters:{
			setstatus(value){
				let title = ''
				if(value == 0){
					title = '处理中'
				}else if(value == 1){
					title = '已到账'
				}else if(value == -1){
					title = '已退款'
				}
				return title
			}
		},
		methods:{
			getList(){
				this.request('fund/getFundList',{
					page: this.pageIndex,
					psize: 10
				}).then(res=>{
					console.log(res)
					this.dataList = res.data
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.record {
	padding: 20upx 30upx;
	background-color: #fff;
	.record_list {
		overflow: hidden;
		margin-bottom: 30upx;
		.month {
			font-size: 36upx;
			font-family: Adobe Heiti Std;
			font-weight: normal;
			color: rgba(51, 51, 51, 1);
			line-height: 21px;
		}
		.month_list{
			height:150upx;
			overflow: hidden;
			background:rgba(255,255,255,1);
			border-bottom: 1upx solid #F2F2F2;
			box-sizing: border-box;
			padding: 30upx 0;
			.left{
				width: 48upx;
				float: left;
				.text1{
					width:48upx;
					height:40upx;
					background:rgba(242,58,58,1);
					border-radius:2upx;
					font-size:28upx;
					font-family:Microsoft YaHei;
					font-weight:400;
					color:rgba(255,255,255,1);
					line-height:40upx;
					text-align: center;
					display: block;
					transform: translateY(8upx);
					margin-bottom: 10upx;
				}
				.text2{
					font-size:24upx;
					font-family:Droid Sans Fallback;
					font-weight:400;
					color:rgba(242,58,58,1);
				}
			}
			.center{
				float: left;
				font-size:36upx;
				font-family:Droid Sans Fallback;
				font-weight:400;
				color:rgba(51,51,51,1);
				margin-top: 10upx;
				margin-left: 30upx;
			}
			.right{
				float: right;
				text-align: right;
				.text1{
					font-size:32upx;
					font-family:Droid Sans Fallback;
					font-weight:400;
					color:#333333;
					display: block;
				}
				.text2{
					font-size:24upx;
					font-family:Droid Sans Fallback;
					font-weight:400;
					color:rgba(153,153,153,1);
				}
				.onstatus{
					color: #F23A3A;
					font-size:32upx;
					font-family:Droid Sans Fallback;
					font-weight:400;
					display: block;
				}
			}
		}
	}
}
</style>
